package edu.fudan.cse.medlab.event.extraction;

import org.apache.log4j.Logger;

import java.io.PrintWriter;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;


/**
 * Author: yiminghe
 * Date: 2008-9-21
 * Time: 18:20:25
 * Any problem ,contact yiminghe@fudan.edu.cn.
 */
public class ExtractLocation {
    static Logger logger = Logger.getLogger(ExtractLocation.class);

    public static void main(String[] args) throws Exception {
        PrintWriter pw = new PrintWriter("location.txt");
        Class.forName("com.mysql.jdbc.Driver");
        java.sql.Connection conn = DriverManager.getConnection(
                "jdbc:mysql://localhost:3306/event", "root", "sunrise");
        Statement stmt = conn.createStatement();
        ResultSet rs = stmt.executeQuery("select * from location");

        while (rs.next()) {
            pw.println(rs.getString("name"));
        }
        rs.close();

        rs = stmt.executeQuery("select * from alias");
        while (rs.next()) {
            pw.println(rs.getString("name"));
        }
        rs.close();
        stmt.close();
        conn.close();
        pw.close();


    }
}
